<?php
//include_once '../classes/class.Sessao.php';
include_once 'master.inc.php';
if ($_POST['frmAcao']) {
  $oMsg = Sessao::login($_POST['frmLogin'], $_POST['frmSenha'], true);

  if ($oMsg === true) {
    Util::redirecionaParaUrl('index.php');
  }
}

?>

<link type="text/css" rel="stylesheet" href="css/main.css">

<style type="text/css">
  html, body {
    margin: 0;
    padding: 0;
  }
  
  #login {
    border: 1px #000 double;
    margin-top: 10%;
  }

  #titulo {
    margin: 0 auto;
    margin-top: 3%;
    width: 775px;
    text-align: center;
    font-size: 50px;
  }

  .msg {
    width: 400px;
    margin: 0 auto;
    margin-top: 8px;
  }
</style>


<div id="titulo">AREA ADMINISTRATIVA</div>
<form method="post" action="login.php">
  <input type="hidden" name="frmAcao" value="true">
  <table id="login" align="center">
    <tr>
      <td>Login:</td>
      <td><input type="text" name="frmLogin"></td>
    </tr>
    <tr>
      <td>Senha:</td>
      <td><input type="password" name="frmSenha"></td>
    </tr>
    <tr>
      <td></td>
      <td><input type="submit" value="Entrar"></td>
    </tr>
  </table>
  <div class="msg">
    <span><?php (is_object($oMsg) ? $oMsg->mostraMsg() : '') ?></span>
  </div>
</form>